# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=umoci
pkgver=0.4.6
pkgrel=0
pkgdesc="umoci modifies Open Container images"
url="https://umo.ci/"
arch="all !mips !mips64"
license="Apache-2.0"
makedepends="go"
options="!check" # has no check
source="umoci-$pkgver.tar.gz::https://github.com/opencontainers/umoci/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/opencontainers/$pkgname"

prepare() {
	mkdir -p ${builddir%/*}
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/
	default_prepare
}

build() {
	export GOPATH="$srcdir"
	go build -o bin/$pkgname ./cmd/$pkgname
}

package() {
	install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname
}

cleanup_srcdir() {
	go clean -modcache
	default_cleanup_srcdir
}

sha512sums="0614dd583e00b6e2e69256f1ae1d3316e5bb5989a177d18c5ceacf3af18ab82ccf8edef879b6c813855d878d5af53c541ac433d81e6c20796885a26c57564118  umoci-0.4.6.tar.gz"
